import Vue from 'vue'
import Router from 'vue-router'

import customer from './customer'
import admin from './admin'

Vue.use(Router)
const router = new Router({
  routes: [
    {
      path: '/',
      redirect: document.URL.indexOf('saas-manage') > 0 ? '/admin' : '/customer',
    },
    {
      path: '/404',
      component: () => import('@/pages/404'),
    },
    ...customer,
    ...admin,
  ],
})

export default router
